package com.mythread;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName MyTry
 * @Description
 * @Author xinggh
 * @Date 2020/8/16 0:27
 * @Version 1.0
 **/
public class MyTry {

    public static void main(String[] args) {

        System.out.println(method2(0));
    }

    public static String getResult() {

        try {
            System.out.println("try开始");
            String s = null;
            int length = s.charAt(0);
            System.out.println("try结束");
            return "try块的返回值";
        } catch (Exception e) {
            System.out.println("捕获到了异常");
            return "catch的返回值";
        } finally {
            return "666";
        }
    }

    public static int method() {
        int x = 1;
        try{
            ++ x;
            return x;
        }catch(Exception e){

        }finally{
            ++ x;
            return x;
        }


    }

    public static int method2( int a) {
        List list = new ArrayList(1000);
        return method2(list.size());
    }



}
